# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-inputstream-ffmpegdirect
pkgver=20.5.0
_realname=Nexus
pkgrel=1
pkgdesc="Supports streams opened by FFmpeg's libavformat or Kodi's cURL such as plain TS, HLS and DASH (non-DRM) as well as many others"
options="!check" # no test suite
url="https://github.com/xbmc/inputstream.ffmpegdirect"
arch="x86_64 aarch64 armv7" # kodi is available only on these architectures
license="GPL-2.0-only"
makedepends="cmake kodi-dev samurai"
source="$pkgname-$pkgver.tar.gz::https://github.com/xbmc/inputstream.ffmpegdirect/archive/$pkgver-$_realname.tar.gz
	ctime.patch
	gcc13.patch
	"
builddir="$srcdir/inputstream.ffmpegdirect-$pkgver-$_realname"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9db8e25f04400635e13cf7c79f7079be9c7ffbf427423abcfc449dcd06f6259dcf9ed1ad1eae1563db239978c8399e054e7c6adcbebb5cc70c4de1c01643d074  kodi-inputstream-ffmpegdirect-20.5.0.tar.gz
9483f8b0b8fafc269f2aeb6156ab7f798154ada57a0dd7cc0578605cfeb90546a7a79de70df67847aaf343a1d86896f9ee2eab9f29872063135902fc370d9f17  ctime.patch
29d5dcb312cbfa9b73f776688c8db7a3488ae8cff172b7585883d2d0dfef487dc49e8ccbe6de74ad7b4e0d4abeb9c12285a5c06726db55b76a8af3b06289c478  gcc13.patch
"
